<template>
  <div class="md:flex">
    <template v-for="(item, index) in growCardList" :key="item.title">
      <Card size="small" :loading="loading" :title="item.title" class="md:w-1/5 w-full !md:mt-0 !mt-5"
        :class="[index + 1 < 5 && '!md:mr-5']" :canExpan="false">
        <template #extra>
          <Tag :color="item.color">{{ item.action }}</Tag>
        </template>

        <div class="py-5 px-5 flex justify-between">
          <CountTo  :startVal="0" :endVal="item.value" class="text-2xl" />
          <Icon :icon="item.icon" :size="40" />
        </div>
      </Card>
    </template>
  </div>
</template>
<script lang="ts" setup>
import { CountTo } from '/@/components/CountTo/index';
import { Icon } from '/@/components/Icon';
import { Tag, Card } from 'ant-design-vue';
import { growCardList } from './data';
import { onMounted, ref, Ref } from 'vue';
import {listM} from './LabDeviceAna.api';

defineProps({
  loading: {
    type: Boolean,
  },
});
// const growCardList =ref([{
//     title: '',
//     icon: '',
//     cvalue: 0,
//     total: 0,
//     color: '',
//     action: '',
// }]);

// onMounted(async() => {
//   growCardLista.value = (await listM()).records;
//   console.log(growCardLista.value);
// })
</script>
